const express = require("express");
const router = express.Router();
const contactDB = require("../../database/contact.js");
// 监听
router.post("/", async (req, res) => {
  let {ly,name,tel,email,qq,desc} = req.body;
  if(ly && name && tel && email && qq && desc){
    await contactDB.create({ly,name,tel,email,qq,desc});
    res.send({
      code:0,
      message:"反馈成功"
    })
  }else{
    res.send({
      code:1,
      message:"反馈的数据不规范"
    })
  }
})


module.exports = router;